package com.消除ifelse.策略工厂方式;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;

/**
 * @Date 2021/1/14 17:04
 * @Author WangLinBao
 * @Description
 */
public class PayStrategyFactory {
    public static Map<String,IPay> payMap = new HashMap<>();

    public static void register(String code,IPay pay){
        if(code!=null){
            payMap.put(code,pay);
        }
    }

    public static IPay get(String code){
        return payMap.get(code);
    }
}
